package com.googlecode.flair
{
	import com.googlecode.flair.components.IFlairComponent;
	
	import mx.managers.PopUpManager;
	
	public class FlairApplication
	{
		
		public static var instance : FlairApplication = null;
		
		public var application : Flair = null;
		private var designAdvisor : DesignAdvisor = null;
		
		public var rootComponent : IFlairComponent = null;
		
		public function FlairApplication()
		{
			instance = this;
		}
		
		
		public final function initializeApplication (application : Flair) : void 
		{
			this.application = application;
			//rootComponent = application.defaultView;
			application.maximize();
			var designAdvisorView : DesignAdvisorView = new DesignAdvisorView(); 
			designAdvisor = new DesignAdvisor(designAdvisorView);
			designAdvisor.advisedComponent = application.defaultView;
			designAdvisorView.controller = designAdvisor;
			
			designAdvisor.rootComponent = application.defaultView;
			designAdvisor.showFor(application);
			designAdvisorView.x = application.x + application.width - 10;
		}

	}
}